package com.lm.temporal.workflow;

import com.lm.temporal.activities.OrderActivities;
import io.temporal.workflow.Workflow;

public class OrderWorkflowImpl implements OrderWorkflow {

    private final OrderActivities activities = Workflow.newActivityStub(
            OrderActivities.class
    );

    @Override
    public void processOrder(String orderId) {
        activities.validate(orderId);
        activities.reduceStock(orderId);
        activities.pay(orderId);
        activities.dispatch(orderId);
    }
}